#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
int msize,N,M;
const int maxn = 10010;
bool isPrime(int x) {
    if(x<=1) return false;
    int i;
    for(i=2; i <= x/2; i++) {
        if(x%i==0) return false;
    }
    return true;
}
int Hash(int index)
{
    return index%msize;
}
int main()
{
    cin>>msize>>N>>M;
    while(!isPrime(msize)) {
        msize++;
    }
    int table[maxn];
    fill(table,table+maxn,-1);
    for(int i = 0; i < N; i++) {
        int ele;
        scanf("%d",&ele);
        bool found = false;
        for(int j=0;j<msize;j++) {
            int index = (Hash(ele)+j*j)%msize;
            if(table[index]==-1) {
                table[index] = ele;
                found = true;
                break;
            }
        }
        if(!found) {
            printf("%d cannot be inserted.\n",ele);
        }
    }
    int tot = 0;    //查找总次数
    for(int i = 0; i < M; i++) {
        int ele;
        scanf("%d",&ele);
        bool found = false;
        for(int j=0;j<msize;j++) {
            tot++;
            int index = (Hash(ele)+j*j)%msize;
            if(table[index]==-1||table[index]==ele) {
                found = true;
                break;
            }
        }
        if(found==false) tot++;
    }
    printf("%.1f\n",tot*1.0/M);
    return 0;
}